<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - /usr/include/c++/5/bits/postypes.h</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../../index.html">top level</a> - <a href="index.html">usr/include/c++/5/bits</a> - postypes.h<span style="font-size: 80%;"> (source / <a href="postypes.h.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:25:26</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntryHi">-</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : // Position types -*- C++ -*-</a>
<span class="lineNum">       2 </span>            : 
<span class="lineNum">       3 </span>            : // Copyright (C) 1997-2015 Free Software Foundation, Inc.
<span class="lineNum">       4 </span>            : //
<span class="lineNum">       5 </span>            : // This file is part of the GNU ISO C++ Library.  This library is free
<span class="lineNum">       6 </span>            : // software; you can redistribute it and/or modify it under the
<span class="lineNum">       7 </span>            : // terms of the GNU General Public License as published by the
<span class="lineNum">       8 </span>            : // Free Software Foundation; either version 3, or (at your option)
<span class="lineNum">       9 </span>            : // any later version.
<span class="lineNum">      10 </span>            : 
<span class="lineNum">      11 </span>            : // This library is distributed in the hope that it will be useful,
<span class="lineNum">      12 </span>            : // but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class="lineNum">      13 </span>            : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
<span class="lineNum">      14 </span>            : // GNU General Public License for more details.
<span class="lineNum">      15 </span>            : 
<span class="lineNum">      16 </span>            : // Under Section 7 of GPL version 3, you are granted additional
<span class="lineNum">      17 </span>            : // permissions described in the GCC Runtime Library Exception, version
<span class="lineNum">      18 </span>            : // 3.1, as published by the Free Software Foundation.
<span class="lineNum">      19 </span>            : 
<span class="lineNum">      20 </span>            : // You should have received a copy of the GNU General Public License and
<span class="lineNum">      21 </span>            : // a copy of the GCC Runtime Library Exception along with this program;
<span class="lineNum">      22 </span>            : // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
<span class="lineNum">      23 </span>            : // &lt;http://www.gnu.org/licenses/&gt;.
<span class="lineNum">      24 </span>            : 
<span class="lineNum">      25 </span>            : /** @file bits/postypes.h
<span class="lineNum">      26 </span>            :  *  This is an internal header file, included by other library headers.
<span class="lineNum">      27 </span>            :  *  Do not attempt to use it directly. @headername{iosfwd}
<span class="lineNum">      28 </span>            :  */
<span class="lineNum">      29 </span>            : 
<span class="lineNum">      30 </span>            : //
<span class="lineNum">      31 </span>            : // ISO C++ 14882: 27.4.1 - Types
<span class="lineNum">      32 </span>            : // ISO C++ 14882: 27.4.3 - Template class fpos
<span class="lineNum">      33 </span>            : //
<span class="lineNum">      34 </span>            : 
<span class="lineNum">      35 </span>            : #ifndef _GLIBCXX_POSTYPES_H
<span class="lineNum">      36 </span>            : #define _GLIBCXX_POSTYPES_H 1
<span class="lineNum">      37 </span>            : 
<span class="lineNum">      38 </span>            : #pragma GCC system_header
<span class="lineNum">      39 </span>            : 
<span class="lineNum">      40 </span>            : #include &lt;cwchar&gt; // For mbstate_t
<span class="lineNum">      41 </span>            : 
<span class="lineNum">      42 </span>            : // XXX If &lt;stdint.h&gt; is really needed, make sure to define the macros
<span class="lineNum">      43 </span>            : // before including it, in order not to break &lt;tr1/cstdint&gt; (and &lt;cstdint&gt;
<span class="lineNum">      44 </span>            : // in C++0x).  Reconsider all this as soon as possible...
<span class="lineNum">      45 </span>            : #if (defined(_GLIBCXX_HAVE_INT64_T) &amp;&amp; !defined(_GLIBCXX_HAVE_INT64_T_LONG) \
<span class="lineNum">      46 </span>            :      &amp;&amp; !defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG))
<span class="lineNum">      47 </span>            : 
<span class="lineNum">      48 </span>            : #ifndef __STDC_LIMIT_MACROS
<span class="lineNum">      49 </span>            : # define _UNDEF__STDC_LIMIT_MACROS
<span class="lineNum">      50 </span>            : # define __STDC_LIMIT_MACROS
<span class="lineNum">      51 </span>            : #endif
<span class="lineNum">      52 </span>            : #ifndef __STDC_CONSTANT_MACROS
<span class="lineNum">      53 </span>            : # define _UNDEF__STDC_CONSTANT_MACROS
<span class="lineNum">      54 </span>            : # define __STDC_CONSTANT_MACROS
<span class="lineNum">      55 </span>            : #endif
<span class="lineNum">      56 </span>            : #include &lt;stdint.h&gt; // For int64_t
<span class="lineNum">      57 </span>            : #ifdef _UNDEF__STDC_LIMIT_MACROS
<span class="lineNum">      58 </span>            : # undef __STDC_LIMIT_MACROS
<span class="lineNum">      59 </span>            : # undef _UNDEF__STDC_LIMIT_MACROS
<span class="lineNum">      60 </span>            : #endif
<span class="lineNum">      61 </span>            : #ifdef _UNDEF__STDC_CONSTANT_MACROS
<span class="lineNum">      62 </span>            : # undef __STDC_CONSTANT_MACROS
<span class="lineNum">      63 </span>            : # undef _UNDEF__STDC_CONSTANT_MACROS
<span class="lineNum">      64 </span>            : #endif
<span class="lineNum">      65 </span>            : 
<span class="lineNum">      66 </span>            : #endif
<span class="lineNum">      67 </span>            : 
<span class="lineNum">      68 </span>            : namespace std _GLIBCXX_VISIBILITY(default)
<span class="lineNum">      69 </span>            : {
<span class="lineNum">      70 </span>            : _GLIBCXX_BEGIN_NAMESPACE_VERSION
<span class="lineNum">      71 </span>            : 
<span class="lineNum">      72 </span>            :   // The types streamoff, streampos and wstreampos and the class
<span class="lineNum">      73 </span>            :   // template fpos&lt;&gt; are described in clauses 21.1.2, 21.1.3, 27.1.2,
<span class="lineNum">      74 </span>            :   // 27.2, 27.4.1, 27.4.3 and D.6. Despite all this verbiage, the
<span class="lineNum">      75 </span>            :   // behaviour of these types is mostly implementation defined or
<span class="lineNum">      76 </span>            :   // unspecified. The behaviour in this implementation is as noted
<span class="lineNum">      77 </span>            :   // below.
<span class="lineNum">      78 </span>            : 
<span class="lineNum">      79 </span>            :   /**
<span class="lineNum">      80 </span>            :    *  @brief  Type used by fpos, char_traits&lt;char&gt;, and char_traits&lt;wchar_t&gt;.
<span class="lineNum">      81 </span>            :    *
<span class="lineNum">      82 </span>            :    *  In clauses 21.1.3.1 and 27.4.1 streamoff is described as an
<span class="lineNum">      83 </span>            :    *  implementation defined type.
<span class="lineNum">      84 </span>            :    *  Note: In versions of GCC up to and including GCC 3.3, streamoff
<span class="lineNum">      85 </span>            :    *  was typedef long.
<span class="lineNum">      86 </span>            :   */  
<span class="lineNum">      87 </span>            : #ifdef _GLIBCXX_HAVE_INT64_T_LONG
<span class="lineNum">      88 </span>            :   typedef long          streamoff;
<span class="lineNum">      89 </span>            : #elif defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG)
<span class="lineNum">      90 </span>            :   typedef long long     streamoff;
<span class="lineNum">      91 </span>            : #elif defined(_GLIBCXX_HAVE_INT64_T) 
<span class="lineNum">      92 </span>            :   typedef int64_t       streamoff;
<span class="lineNum">      93 </span>            : #else
<span class="lineNum">      94 </span>            :   typedef long long     streamoff;
<span class="lineNum">      95 </span>            : #endif
<span class="lineNum">      96 </span>            : 
<span class="lineNum">      97 </span>            :   /// Integral type for I/O operation counts and buffer sizes.
<span class="lineNum">      98 </span>            :   typedef ptrdiff_t     streamsize; // Signed integral type
<span class="lineNum">      99 </span>            : 
<span class="lineNum">     100 </span>            :   /**
<span class="lineNum">     101 </span>            :    *  @brief  Class representing stream positions.
<span class="lineNum">     102 </span>            :    *
<span class="lineNum">     103 </span>            :    *  The standard places no requirements upon the template parameter StateT.
<span class="lineNum">     104 </span>            :    *  In this implementation StateT must be DefaultConstructible,
<span class="lineNum">     105 </span>            :    *  CopyConstructible and Assignable.  The standard only requires that fpos
<span class="lineNum">     106 </span>            :    *  should contain a member of type StateT. In this implementation it also
<span class="lineNum">     107 </span>            :    *  contains an offset stored as a signed integer.
<span class="lineNum">     108 </span>            :    *
<span class="lineNum">     109 </span>            :    *  @param  StateT  Type passed to and returned from state().
<span class="lineNum">     110 </span>            :    */
<span class="lineNum">     111 </span>            :   template&lt;typename _StateT&gt;
<span class="lineNum">     112 </span>            :     class fpos
<span class="lineNum">     113 </span>            :     {
<span class="lineNum">     114 </span>            :     private:
<span class="lineNum">     115 </span>            :       streamoff                 _M_off;
<span class="lineNum">     116 </span>            :       _StateT                   _M_state;
<span class="lineNum">     117 </span>            : 
<span class="lineNum">     118 </span>            :     public:
<span class="lineNum">     119 </span>            :       // The standard doesn't require that fpos objects can be default
<span class="lineNum">     120 </span>            :       // constructed. This implementation provides a default
<span class="lineNum">     121 </span>            :       // constructor that initializes the offset to 0 and default
<span class="lineNum">     122 </span>            :       // constructs the state.
<span class="lineNum">     123 </span>            :       fpos()
<span class="lineNum">     124 </span>            :       : _M_off(0), _M_state() { }
<span class="lineNum">     125 </span>            : 
<span class="lineNum">     126 </span>            :       // The standard requires that fpos objects can be constructed
<span class="lineNum">     127 </span>            :       // from streamoff objects using the constructor syntax, and
<span class="lineNum">     128 </span>            :       // fails to give any meaningful semantics. In this
<span class="lineNum">     129 </span>            :       // implementation implicit conversion is also allowed, and this
<span class="lineNum">     130 </span>            :       // constructor stores the streamoff as the offset and default
<span class="lineNum">     131 </span>            :       // constructs the state.
<span class="lineNum">     132 </span>            :       /// Construct position from offset.
<span class="lineNum">     133 </span>            :       fpos(streamoff __off)
<span class="lineNum">     134 </span><span class="lineNoCov">          0 :       : _M_off(__off), _M_state() { }</span>
<span class="lineNum">     135 </span>            : 
<span class="lineNum">     136 </span>            :       /// Convert to streamoff.
<span class="lineNum">     137 </span>            :       operator streamoff() const { return _M_off; }
<span class="lineNum">     138 </span>            : 
<span class="lineNum">     139 </span>            :       /// Remember the value of @a st.
<span class="lineNum">     140 </span>            :       void
<span class="lineNum">     141 </span>            :       state(_StateT __st)
<span class="lineNum">     142 </span>            :       { _M_state = __st; }
<span class="lineNum">     143 </span>            : 
<span class="lineNum">     144 </span>            :       /// Return the last set value of @a st.
<span class="lineNum">     145 </span>            :       _StateT
<span class="lineNum">     146 </span>            :       state() const
<span class="lineNum">     147 </span>            :       { return _M_state; }
<span class="lineNum">     148 </span>            : 
<span class="lineNum">     149 </span>            :       // The standard requires that this operator must be defined, but
<span class="lineNum">     150 </span>            :       // gives no semantics. In this implementation it just adds its
<span class="lineNum">     151 </span>            :       // argument to the stored offset and returns *this.
<span class="lineNum">     152 </span>            :       /// Add offset to this position.
<span class="lineNum">     153 </span>            :       fpos&amp;
<span class="lineNum">     154 </span>            :       operator+=(streamoff __off)
<span class="lineNum">     155 </span>            :       {
<span class="lineNum">     156 </span>            :         _M_off += __off;
<span class="lineNum">     157 </span>            :         return *this;
<span class="lineNum">     158 </span>            :       }
<span class="lineNum">     159 </span>            : 
<span class="lineNum">     160 </span>            :       // The standard requires that this operator must be defined, but
<span class="lineNum">     161 </span>            :       // gives no semantics. In this implementation it just subtracts
<span class="lineNum">     162 </span>            :       // its argument from the stored offset and returns *this.
<span class="lineNum">     163 </span>            :       /// Subtract offset from this position.
<span class="lineNum">     164 </span>            :       fpos&amp;
<span class="lineNum">     165 </span>            :       operator-=(streamoff __off)
<span class="lineNum">     166 </span>            :       {
<span class="lineNum">     167 </span>            :         _M_off -= __off;
<span class="lineNum">     168 </span>            :         return *this;
<span class="lineNum">     169 </span>            :       }
<span class="lineNum">     170 </span>            : 
<span class="lineNum">     171 </span>            :       // The standard requires that this operator must be defined, but
<span class="lineNum">     172 </span>            :       // defines its semantics only in terms of operator-. In this
<span class="lineNum">     173 </span>            :       // implementation it constructs a copy of *this, adds the
<span class="lineNum">     174 </span>            :       // argument to that copy using operator+= and then returns the
<span class="lineNum">     175 </span>            :       // copy.
<span class="lineNum">     176 </span>            :       /// Add position and offset.
<span class="lineNum">     177 </span>            :       fpos
<span class="lineNum">     178 </span>            :       operator+(streamoff __off) const
<span class="lineNum">     179 </span>            :       {
<span class="lineNum">     180 </span>            :         fpos __pos(*this);
<span class="lineNum">     181 </span>            :         __pos += __off;
<span class="lineNum">     182 </span>            :         return __pos;
<span class="lineNum">     183 </span>            :       }
<span class="lineNum">     184 </span>            : 
<span class="lineNum">     185 </span>            :       // The standard requires that this operator must be defined, but
<span class="lineNum">     186 </span>            :       // defines its semantics only in terms of operator+. In this
<span class="lineNum">     187 </span>            :       // implementation it constructs a copy of *this, subtracts the
<span class="lineNum">     188 </span>            :       // argument from that copy using operator-= and then returns the
<span class="lineNum">     189 </span>            :       // copy.
<span class="lineNum">     190 </span>            :       /// Subtract offset from position.
<span class="lineNum">     191 </span>            :       fpos
<span class="lineNum">     192 </span>            :       operator-(streamoff __off) const
<span class="lineNum">     193 </span>            :       {
<span class="lineNum">     194 </span>            :         fpos __pos(*this);
<span class="lineNum">     195 </span>            :         __pos -= __off;
<span class="lineNum">     196 </span>            :         return __pos;
<span class="lineNum">     197 </span>            :       }
<span class="lineNum">     198 </span>            : 
<span class="lineNum">     199 </span>            :       // The standard requires that this operator must be defined, but
<span class="lineNum">     200 </span>            :       // defines its semantics only in terms of operator+. In this
<span class="lineNum">     201 </span>            :       // implementation it returns the difference between the offset
<span class="lineNum">     202 </span>            :       // stored in *this and in the argument.
<span class="lineNum">     203 </span>            :       /// Subtract position to return offset.
<span class="lineNum">     204 </span>            :       streamoff
<span class="lineNum">     205 </span>            :       operator-(const fpos&amp; __other) const
<span class="lineNum">     206 </span>            :       { return _M_off - __other._M_off; }
<span class="lineNum">     207 </span>            :     };
<span class="lineNum">     208 </span>            : 
<span class="lineNum">     209 </span>            :   // The standard only requires that operator== must be an
<span class="lineNum">     210 </span>            :   // equivalence relation. In this implementation two fpos&lt;StateT&gt;
<span class="lineNum">     211 </span>            :   // objects belong to the same equivalence class if the contained
<span class="lineNum">     212 </span>            :   // offsets compare equal.
<span class="lineNum">     213 </span>            :   /// Test if equivalent to another position.
<span class="lineNum">     214 </span>            :   template&lt;typename _StateT&gt;
<span class="lineNum">     215 </span>            :     inline bool
<span class="lineNum">     216 </span>            :     operator==(const fpos&lt;_StateT&gt;&amp; __lhs, const fpos&lt;_StateT&gt;&amp; __rhs)
<span class="lineNum">     217 </span>            :     { return streamoff(__lhs) == streamoff(__rhs); }
<span class="lineNum">     218 </span>            : 
<span class="lineNum">     219 </span>            :   template&lt;typename _StateT&gt;
<span class="lineNum">     220 </span>            :     inline bool
<span class="lineNum">     221 </span>            :     operator!=(const fpos&lt;_StateT&gt;&amp; __lhs, const fpos&lt;_StateT&gt;&amp; __rhs)
<span class="lineNum">     222 </span>            :     { return streamoff(__lhs) != streamoff(__rhs); }
<span class="lineNum">     223 </span>            : 
<span class="lineNum">     224 </span>            :   // Clauses 21.1.3.1 and 21.1.3.2 describe streampos and wstreampos
<span class="lineNum">     225 </span>            :   // as implementation defined types, but clause 27.2 requires that
<span class="lineNum">     226 </span>            :   // they must both be typedefs for fpos&lt;mbstate_t&gt;
<span class="lineNum">     227 </span>            :   /// File position for char streams.
<span class="lineNum">     228 </span>            :   typedef fpos&lt;mbstate_t&gt; streampos;
<span class="lineNum">     229 </span>            :   /// File position for wchar_t streams.
<span class="lineNum">     230 </span>            :   typedef fpos&lt;mbstate_t&gt; wstreampos;
<span class="lineNum">     231 </span>            : 
<span class="lineNum">     232 </span>            : #if __cplusplus &gt;= 201103L
<span class="lineNum">     233 </span>            :   /// File position for char16_t streams.
<span class="lineNum">     234 </span>            :   typedef fpos&lt;mbstate_t&gt; u16streampos;
<span class="lineNum">     235 </span>            :   /// File position for char32_t streams.
<span class="lineNum">     236 </span>            :   typedef fpos&lt;mbstate_t&gt; u32streampos;
<span class="lineNum">     237 </span>            : #endif
<span class="lineNum">     238 </span>            : 
<span class="lineNum">     239 </span>            : _GLIBCXX_END_NAMESPACE_VERSION
<span class="lineNum">     240 </span>            : } // namespace
<span class="lineNum">     241 </span>            : 
<span class="lineNum">     242 </span>            : #endif
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
